﻿@inherits Umbraco.Web.Macros.PartialViewMacroPage
@using umbraco.MacroEngines
@{
    var homeNode = Model.Content.AncestorOrSelf("Home");
}
<!--menu-->
<div class="navbar">
    <div class="navbar-inner">
        <ul class="sf-menu">
            @{ int count = 1;
               foreach (IPublishedContent child in homeNode.Children.Where(n => n.DocumentTypeAlias == "Menu" || n.DocumentTypeAlias == "Contacts"))
               {
                   dynamic logo = new DynamicMedia(@child.GetPropertyValue("commonPicture"));
                     var imgSrc = "/img/splash_icon" + count + ".png";
                     var countNum = count < 9 ? "0" + count.ToString() : count.ToString();
                     count++;              
				   var url = child.GetPropertyValue("commonUrl")!="" ? child.GetPropertyValue("commonUrl") : child.Url();
               
                                 
                <li><a href="@url">
                    <img src="@logo.umbracoFile" alt="">
                    <div class="base_text">
                        @child.GetPropertyValue("commonTitle")
                    </div>
                    <div class="num_text">@countNum</div>
                </a></li>
               }
            }
        </ul>
    </div>
</div>
